package com.business.business.web.web;

import cn.hutool.json.JSONObject;
import com.business.business.common.base.BaseController;
import com.business.business.support.annotaion.Action;
import com.business.business.support.model.RespEntity;
import com.business.business.web.service.EnterpriseService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;


/**
 * @Author xulumin
 * @Date 2024/3/20 15:38
 * @Version 1.0
 * @Desc 一企一档大屏控制器
 */
@Controller
@Action
@RequestMapping(value = "enterprise")
public class EnterpriseController extends BaseController {

    @Resource
    private EnterpriseService enterpriseService;


    /**
     * Author: xulumin
     * Date: 2024/3/19
     * Description: 区域概况查询
     */
    @GetMapping("getRegionalInfo")
    public RespEntity getRegionalInfo(@RequestBody(required = false) JSONObject jsonObject) throws IllegalAccessException, InstantiationException {
        return enterpriseService.getRegionalInfo(jsonObject);
    }

    /**
     * Author: xulumin
     * Date: 2024/3/19
     * Description: 辖区行业分布情况
     */
    @GetMapping("getIndustryInfo")
    public RespEntity getIndustryInfo(@RequestBody(required = false) JSONObject jsonObject) throws IllegalAccessException, InstantiationException {
        return enterpriseService.getIndustryInfo(jsonObject);
    }


    /**
     * Author: xulumin
     * Date: 2024/3/19
     * Description: 辖区预警提醒
     */
    @GetMapping("getAreaWarning")
    public RespEntity getAreaWarning(@RequestBody(required = false) JSONObject jsonObject) throws IllegalAccessException, InstantiationException {
        return enterpriseService.getAreaWarning(jsonObject);
    }


    /**
     * @Author: xulumin
     * @ClassName: DeviceSwitchController
     * @Date: Created in 9:23 2024.03.26
     * @Description: 一企一档大屏查询设备报警
     */
    @GetMapping("getAreaDeviceInfo")
    public RespEntity getAreaDeviceInfo(@RequestBody(required = false)JSONObject jsonObject) {
        return enterpriseService.getAreaDeviceInfo(jsonObject);
    }

}
